package com.copm.ifm.common.process.core.emum;

import com.copm.ifm.base.basic.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 比较方式枚举
 *
 * @author zzf
 * @date 2021/2/26 14:26
 */
@Getter
@AllArgsConstructor
public enum CompareTypeEnum implements BaseEnum {

    EQUALS(1, "等于"),
    LARGE(2, "大于"),
    LESS(3, "小于"),
    BETWEEN(4, "在...区间内"),
    NOT_BETWEEN(5, "不在...区间内"),
    IN(6, "在...之中"),
    NOT_IN(7, "不在...之中");

    private final int key;

    private final String value;

    public static CompareTypeEnum getByKey(int key) {
        for (CompareTypeEnum compareTypeEnum : CompareTypeEnum.values()) {
            if (compareTypeEnum.getKey() == key) {
                return compareTypeEnum;
            }
        }
        return null;
    }

}
